/**
 * 
 * @author "Cunxin Jia"
 *
 */
public class Term {
	private String var;
	private boolean isConstant;
	
	public Term(String var, boolean isGround) {
		this.var = var.trim();
		this.isConstant = isGround;
	}
	
	public Term(String varString) {
		this.var = varString;
		if(var.charAt(0) >= 'A' && var.charAt(0) <= 'Z') {
			isConstant = false;
		}
		else {
			isConstant = true;
		}
	}
	
	public String getVar() {
		return var;
	}
	
	public boolean isConstant() {
		return isConstant;
	}
	
	
	
	@Override
	public boolean equals(Object o) {
		Term t = (Term) o;
		if(var.equals(t.getVar()) && isConstant == t.isConstant())
			return true;
		else
			return false;
	}
	
	@Override
	public int hashCode() {
		return var.hashCode();
	}
}
